<?php

namespace App\Console\Commands\Tasks;

use App\Services\Business\UserService;
use App\Services\Game\NewLottery;
use Illuminate\Console\Command;
use App\Http\Controllers\Common\TaskController;

class AutoSearchUserRegionCommand extends Command
{
    // 命令名
    protected $signature = 'task:auto_search_user_region';

    // 命令描述
    protected $description = '根据用户ip自动定位用户所在城市';

    public function __construct()
    {
        parent::__construct();
    }

    //业务处理
    public function handle()
    {
        try {
            echo "start" . PHP_EOL;
            $newLottery = new NewLottery();
            $res = (new UserService())->autoSearchUserRegion();
            echo "finished:" . $res . PHP_EOL;
        } catch (\Exception $exception) {
            echo $exception->getMessage();
        }
    }

}